#ifndef SCROLLEDFITSVIEW_H
#define SCROLLEDFITSVIEW_H

#include <QObject>
#include <QWheelEvent>
#include <QMouseEvent>
#include <QScrollBar>
#include <QScrollArea>
//#include "colormap.h"
#include <cstdio>
#include <iostream>
using namespace std;
#include <CCfits>
using namespace CCfits;
#include "fitsview.h"

#include "scrolledfitsview.h"

class ScrolledFitsView : public QScrollArea {
	Q_OBJECT
	FitsView *fitsView;
	double zoom;
public:
	ScrolledFitsView(QWidget *parent = 0);
	~ScrolledFitsView();
	virtual QSize minimumSizeHint() const;
public slots:
	void setFits(FITS *fits);
	void setColormap(const unsigned *map);
	void setZoomi(int zoom);
	void setZoom(double zoom);
	void multZoomi(int zoomFactor);
	void multZoom(double zoomFactor);
	void setGray(double midValue, double grayScale);
	void rotate(int angle);
signals:
	void grayChanged(double midValue, double grayScale);
protected:
	/// implementation of virtual in QScrollArea
	void wheelEvent(QWheelEvent*);
	/// implementation of virtual in QScrollArea
	void mousePressEvent(QMouseEvent*);
	/// implementation of virtual in QScrollArea
	void mouseMoveEvent(QMouseEvent*);
	void mouseEvent(QMouseEvent*);
	/// implementation of virtual in QScrollArea
	void resizeEvent(QResizeEvent*);
};

#endif // SCROLLEDFITSVIEW_H
